const ARRERS = ["否", "是"];

const OPEN_OR_CLOSE = ["弃用", "启用"];

const PRE_STORED_REWARDS = ["享受折扣", "福利奖品", ""];

const RECHARGE_PARAM = {
  pageNum: 1,
  pageSize: 10,
  userId: null,
  orderSn: null,
  account: null,
  payTime: null,
  payId: null,
  payStatus: null,
  payType: null,
  rewardType: null,
};

/**
 * 用户搜索
 */
const USER_SEARCH_PARAM = {
  pageNum: 1,
  pageSize: 10,
  id: null,
  userName: null,
  wxCode: null,
  password: null,
  salt: null,
  avatar: null,
  realname: null,
  mobile: null,
  email: null,
  sex: null,
  description: null,
  organizationCode: null,
  age: null,
  teamId: null,
  birthday: null,
  identity: null,
  status: null,
  lastLoginTime: null,
  recommendedUserId: null,
  lastLoginIp: null,
};

/**
 * 支付状态
 */
const RECHARGE_STATUS = ["待支付", "已支付"];

const REWARD_STATUS_OPTIONS = [
  {
    id: 0,
    name: "待支付",
  },
  {
    id: 1,
    name: "已支付",
  },
  // {
  //   id: 2,
  //   name: "交易关闭",
  // },
];

/**
 * 支付管理状态
 * -1：取消订单；0  待支付，1待确认，2待派搞, 3 待处理, 4 处理中，5，已返搞
 */
const ORDER_STATUS = {
  "-1": "已取消",
  0: "待定价",
  1: "已定价",
  2: "待支付",
  3: "待确认",
  4: "处理中",
  5: "待派稿",
  6: "已返稿",
  7: "返回编辑确认",
  8: "待审核",
  9: "未通过",
  10: "已确认",
  11: "已完成",
  12: "未通过",
};

const ORDER_STATUS_OPTIONS = [
  {
    id: 1,
    name: "待支付",
  },
  {
    id: 2,
    name: "已支付",
  },
];

const PAY_MANAGER_STATUS = [
  // {
  //   id: -1,
  //   name: "取消支付",
  // },
  {
    id: 0,
    name: "待支付",
  },
  {
    id: 1,
    name: "待确认",
  },
  {
    id: 2,
    name: "已支付",
  },
];

const TRANSLATE_STATUS = ['未开票', '审核中', '已开票', '未通过'];
const TRANSLATE_STATUS_OPTIONS = [
  {
    id: 0,
    name: "未开票",
  },
  {
    id: 1,
    name: "已开票",
  },
];
const URGENT = ["否", "是"];

const SERVICE_STATUS = ["正常", "反馈", "售后", "新增"];

/**
 * 编辑标题对象
 */
const EDIT_DESCRIPTION = {
  article: "文章标题",
  wordSize: "字 数",
  servicePrice: "报价金额",
  recommendNumber: "篇数",
  processMoney: "编辑金额",
};

/**
 * 编辑存贮对象key对象
 */
const EDIT_BY_ORDER_KEY = {
  article: "article",
  wordSize: "wordSize",
  servicePrice: "servicePrice",
  recommendNumber: "recommendNumber",
  processMoney: "processMoney",
};

/**
 * 字段类型
 */
const FIELD_TYPE = {
  article: "text",
  wordSize: "number",
  servicePrice: "number",
  recommendNumber: "number",
  processMoney: "number",
};

/**
 * 编辑字段 URL
 */
const EDIT_ORDER_URL = {
  article: "/order/order/updateArticle",
  wordSize: "/order/order/updateWordSize",
  servicePrice: "/order/order/quotation",
  recommendNumber: "/order/order/updateNumberOfArticles",
  processMoney: "/order/order/assignOrderNoLog",
};

/**
 * 订单详情显示的label
 */
const ORDER_DETAIL_SHOW_LABEL = ["字数", "推荐篇数"];

const WATCH_ID = {
  id: {
    handler: function (value) {
      this.queryParams.id = value;
    },
    immediate: true,
  },
};

const PROPS_ID = {
  id: {
    type: Number,
    default: 0,
  },
};
/**
 * 出入账
 */
const INCOMING_AND_OUTGOING_ACCOUNTS = ["出账", "入账"];

const CHANGE_TYPE_FUNCTION = [
  (row, money) => {
    console.log("row", row);
    row.academicCurrency = (parseInt(row.academicCurrency) - money).toFixed(2);
  },
  (row, money) => {
    console.log("money", money);
    row.academicCurrency = (parseInt(row.academicCurrency) + money).toFixed(2);
  },
];

const ORDERS_MOUDLE_TATUSES = {
  "-1": "已取消",
  0: "待定价",
  1: "已定价",
  2: "待支付",
  3: "待确认",
  4: "处理中",
  5: "待派稿",
  6: "已返稿",
  7: "返回编辑确认",
  8: "待审核",
  9: "未通过",
  10: "已确认",
  11: "已完成",
};

// 编辑端订单状态
const EDIT_ORDER_STATUS = {
  0: "待处理",
  1: "处理中",
  2: "已返稿",
  3: "返回编辑确认",
  4: "已完成",
};

/**
 * 报价 修改报价
 */
const PRICE_WORD_LABEL = ["报价", "修改报价"];

const APPLY_WITHDRAW_LABEL = ["待审核", "未通过", "已通过"];

const WITHDRAW_STATUS = ["未打款", "已打款", "待操作"];

const ORDER_LOG_STATUS = {
  "-1": "取消订单",
  0: "提交订单:待客服报价",
  1: "客服报价",
  2: "提交订单",
  3: "立即支付:待确认",
  4: "处理订单",
  5: "编辑已返稿",
  6: "提交申请: 待审核",
  7: "审核未通过",
  8: "服务评价",
  9: "创建订单",
  10: "售后服务",
  11: "反馈服务",
  12: "取消二次服务", //售后
  13: "取消二次服务", //反馈
  14: "立即支付",
  15: "变更支付状态: 已支付",
  16: "变更支付状态: 未支付",
  17: "完工确认",
  18: "稿件重审",
  19: "订单派稿",
  20: "服务评价",
  21: "审核通过",
  22: "提交订单:待确认",
  23: "变更服务类型: 反馈",
  24: "变更服务类型: 售后",
};

const SERVER_TYPE = [
  {
    value: undefined,
    label: "全部",
  },
  {
    value: "翻译润色",
    label: "翻译润色",
  },
  {
    value: "科研绘图",
    label: "科研绘图",
  },
];

/**
 * 关联搜索
 */
const ASSOC_SEARCH_BY_USER = {
  id: undefined,
  startTime: undefined,
  endTime: undefined,
  pageNum: 1,
  pageSize: 30,
};

const TRANSLATE_CONTENT = [
  "英文润色费",
  "语言编辑费",
  "校对服务费",
  "翻译服务费",
  "文献检索服务费",
  "科研绘图费", 
  "图文设计费", 
  "数据分析服务费",
  "信息服务费",
  "技术服务费", 
  "技术咨询费",
  "科技信息咨询",
  "其它类型需求可联系客服（选前请确保所选种类符合你单位要求）"
];
const TRASLATE_TYPE = ["个人", "企业"];

const TRASLATE_TYPT_OPTIONS = [
  {
    id: 0,
    name: "个人",
  },
  {
    id: 1,
    name: "企业",
  },
];

const TRASLATE_APPLY = ["待审核", "未通过", "已通过"];

const TRASLATE_APPLY_OPTIONS = [
  {
    id: 0,
    name: "待审核",
  },
  {
    id: 1,
    name: "未通过",
  },
  {
    id: 2,
    name: "已通过",
  },
];

const RECHARGE_TRANSLATE = ["预存发票", "订单发票"];

const RECHARGE_TRANSLATE_OPTIONS = [
  {
    id: 0,
    name: "预存发票",
  },
  {
    id: 1,
    name: "订单发票",
  },
];

const JOURNALS_CLASS_LABEL = ["一区", "二区", "三区", "四区"]; //废弃

const MESSAGE_TYPE = ["群发", "个人"];

const NOTIFICATIONS = [
  "订单通知",
  "二次服务通知",
  "开票通知",
  "团队通知",
  "预存通知",
  "提现通知",
];

const MESSAGE_STATUS = ["未读", "已读"];

const NOTIFICATIONS_URL = [
  {
    url: "/order/detail",
    editURL: "/order/index",
    requestURL: "/order/order",
  },
  {
    url: "/order/detail",
    editURL: "/order/index",
    requestURL: "/order/order",
  },
  {
    url: "/finance/translate/index",
  },
  {
    url: "/team/sign",
  },
  {
    url: "/finance/recharge/index",
  },
  {
    url: "/finance/withdrawal/index",
  },
];

const NOTIFICATIONS_NUMBER = {
  orderNotice: {
    text: "订单通知",
    num: 5,
    isAdmin: false,
  },
  secondaryServiceNotice: {
    text: "二次服务通知",
    num: 3,
    isAdmin: false,
  },
  invoiceNotice: {
    text: "开票通知",
    num: 10,
    isAdmin: true,
  },
  teamNotice: {
    text: "团队通知",
    num: 8,
    isAdmin: true,
  },
  depositNotice: {
    text: "预存通知",
    num: 2,
    isAdmin: true,
  },
  withdrawalNotice: {
    text: "提现通知",
    num: 1,
    isAdmin: true,
  },
};

export {
  NOTIFICATIONS_URL,
  NOTIFICATIONS_NUMBER,
  MESSAGE_STATUS,
  NOTIFICATIONS,
  MESSAGE_TYPE,
  SERVER_TYPE,
  JOURNALS_CLASS_LABEL,
  OPEN_OR_CLOSE,
  RECHARGE_TRANSLATE,
  TRASLATE_APPLY,
  TRASLATE_TYPE,
  TRANSLATE_CONTENT,
  APPLY_WITHDRAW_LABEL,
  WITHDRAW_STATUS,
  EDIT_ORDER_URL,
  ORDER_DETAIL_SHOW_LABEL,
  EDIT_DESCRIPTION,
  EDIT_BY_ORDER_KEY,
  ORDERS_MOUDLE_TATUSES,
  PRICE_WORD_LABEL,
  INCOMING_AND_OUTGOING_ACCOUNTS,
  PROPS_ID,
  ORDER_LOG_STATUS,
  WATCH_ID,
  ARRERS,
  ASSOC_SEARCH_BY_USER,
  CHANGE_TYPE_FUNCTION,
  URGENT,
  SERVICE_STATUS,
  TRANSLATE_STATUS,
  ORDER_STATUS,
  RECHARGE_STATUS,
  RECHARGE_PARAM,
  USER_SEARCH_PARAM,
  PRE_STORED_REWARDS,
  REWARD_STATUS_OPTIONS,
  ORDER_STATUS_OPTIONS,
  TRANSLATE_STATUS_OPTIONS,
  PAY_MANAGER_STATUS,
  FIELD_TYPE,
  TRASLATE_TYPT_OPTIONS,
  RECHARGE_TRANSLATE_OPTIONS,
  TRASLATE_APPLY_OPTIONS,
  EDIT_ORDER_STATUS,
};
